﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AgentViewLots.aspx.cs" Inherits="CRM_Project.AgentViewLots" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <h1>View Vehicles on Lots</h1>
    <form id="form1" runat="server">
    <div>
        <asp:DropDownList id="lotlist" runat="server" DataSourceID="LinqDataSource1" 
            DataTextField="ID" DataValueField="ID">
            <asp:ListItem>All Lots</asp:ListItem>
            <asp:ListItem>Lot 1</asp:ListItem>
            <asp:ListItem>Lot 2</asp:ListItem>
            <asp:ListItem>Lot 3</asp:ListItem>
            <asp:ListItem>Lot 4</asp:ListItem>
            <asp:ListItem>Lot 5</asp:ListItem>
            <asp:ListItem>...</asp:ListItem>
        </asp:DropDownList>
        <asp:Button ID="filterbutton" Text="Filter" OnClick="filterbutton_Click" runat="server"/>
        
    </div>
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="LinqDataSource2" Width="56px">
        <Columns>
            <asp:BoundField DataField="ID" HeaderText="ID" ReadOnly="True" 
                SortExpression="ID" />
            <asp:BoundField DataField="LotID" HeaderText="LotID" ReadOnly="True" 
                SortExpression="LotID" />
            <asp:BoundField DataField="StatusID" HeaderText="StatusID" ReadOnly="True" 
                SortExpression="StatusID" />
        </Columns>
    </asp:GridView>
    <asp:LinqDataSource ID="LinqDataSource1" runat="server" 
        ContextTypeName="CRM_Project.crmengine" Select="new (ID)" TableName="Lots">
    </asp:LinqDataSource>
    <asp:LinqDataSource ID="LinqDataSource2" runat="server" 
        ContextTypeName="CRM_Project.crmengine" 
        Select="new (ID, LotID, Status, StatusID)" TableName="Cars">
    </asp:LinqDataSource>
    </form>
</body>
</html>
